xend: allow hvm domain to have multiple serial consoles
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 1 Apr 2009 10:44:49 +0000 (11:44 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 1 Apr 2009 10:44:49 +0000 (11:44 +0100)
This patch allows hvm domain to have multiple serial ports
with serial =3D [ '...', '...'].
The old style, serial=3D'option string', is also accepted for
compatibility.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
tools/python/xen/xend/image.py

index 239165b55f5a6ee1544ce566d3710905ce56d1ad..14b46fd586ca6b9416b9b54eefc8bb188abc3740 100644 (file)
@@ -781,6 +781,14 @@ class HVMImageHandler(ImageHandler):
                     if v: ret.append("-%s" % a)
                 except (ValueError, TypeError):
                     pass # if we can't convert it to a sane type, ignore it
+            elif a == 'serial':
+                if v:
+                    if type(v) == str:
+                        v = [v]
+                    for s in v:
+                        if s:
+                            ret.append("-serial")
+                            ret.append("%s" % s)
             else:
                 if v:
                     ret.append("-%s" % a)